body * {
  box-sizing: border-box;
  flex-shrink: 0;
}

body {
  font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma,
    Arial, PingFang SC-Light, Microsoft YaHei;
}

button {
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  outline: none;
  background-color: transparent;
}

button:active {
  opacity: 0.6;
}

/* 文字溢出隐藏 */
.text-clip,
.text-1 {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* 多行文字换行 */
.text-2 {
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 24rpx;
    /* line-height: 1; */
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.justify-start {
  display: flex;
  justify-content: flex-start;
}

.justify-center {
  display: flex;
  justify-content: center;
}

.justify-end {
  display: flex;
  justify-content: flex-end;
}

.justify-evenly {
  display: flex;
  justify-content: space-evenly;
}

.justify-around {
  display: flex;
  justify-content: space-around;
}

.justify-between {
  display: flex;
  justify-content: space-between;
}

.align-start {
  display: flex;
  align-items: flex-start;
}

.align-center {
  display: flex;
  align-items: center;
}

.align-end {
  display: flex;
  align-items: flex-end;
}


// 定义width
@for $i from 25 through 100 {
  @if $i % 25==0 {
    .w#{$i} {
      width: #{$i * 1%};
    }
  }
}

.h100 {
  height: 100%;
}

/* 防止图片闪动 */
image {
  will-change: transform
}

.al {
  text-align: left
}

.ac {
  text-align: center
}

.ar {
  text-align: right
}

.hide {
  display: none !important;
}

.show {
  display: block !important;
}


.c333 {
  color: #333;
}

.c666 {
  color: #666;
}

.c999 {
  color: #999;
}


.cred {
  color: #7AB12E;
}

.cwhite {
  color: #fff;
}

.cwhited {
  color: #fff;
  opacity: 07;
}

.cyellow {
  color: #FFC531;
}

.bgwhite {
  background: #fff;
}

.bgred {
  background: #7AB12E;
}

// 去除button的所有默认样式，让其表现跟普通的view、text元素一样
.reset_button {
  margin: 0;
  padding: 0;
  outline: none;
  border: none;
  background: none;
  font-size: inherit;
  height: auto;
  line-height: 1;
  color: inherit;
}

.reset_button::after {
  border: none;
}


/* 使用css样式，扩大可点击区域： */
.large {
  position: relative;
}

.large:before {
  content: '';
  position: absolute;
  top: -20rpx;
  bottom: -20rpx;
  left: -20rpx;
  right: -20rpx;
}

/********** fle布局 *********/
.flex,
.flex-row,
.flex-column {
  display: flex;
}

.flex-inline {
  display: inline;
}

/* 水平方向*/
.flex-row {
  flex-direction: row;
}

/* 垂直方向 */
.flex-column {
  flex-direction: column;
}

/* 水平方向换行 */
.flex-row-wrap {
  flex-wrap: wrap;
}

/* 水平方向不换行 */
.flex-nowrap {
  flex-wrap: nowrap;
}


/* 水平方向，起点在右端 */
.flex-row-reverse {
  flex-direction: row-reverse;
}

.flex-row>* {
  display: block;
}

.flex-col {
  /* flex: 1; */
  flex: 1 1 0%;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-middle {
  align-items: center;
}

.flex-justify-center {
  justify-content: center;
}

.flex-justify-start {
  justify-content: flex-start;
}

.flex-justify-end {
  justify-content: flex-end;
}

.flex-justify-space-between {
  justify-content: space-between;
}

.flex-justify-space-around {
  justify-content: space-around;
}

.flex-align-start {
  align-content: flex-start;
}

.flex-align-end {
  align-content: flex-end;
}

.flex-align-around {
  align-content: space-around;
}

.flex-align-between {
  align-content: space-between;
}

.flex-col-auto {
  flex: 0 auto;
}

/********** fle布局 *********/



// 定义字体粗细
@for $i from 100 through 800 {
  @if $i % 100==0 {

    // .u-weight-#{$i},
    .f-w-#{$i} {
      font-weight: $i;
    }
  }
}

// 定义flex等分
@for $i from 0 through 12 {
  .u-flex-#{$i} {
    flex: $i;
  }
}

// 定义字体(px)单位，小于20都为px单位字体
@for $i from 5 to 20 {
  .f-z-#{$i} {
    font-size: $i + px;
  }
}

// 定义字体(rpx)单位，大于或等于20的都为rpx单位字体
@for $i from 20 through 60 {
  .f-z-#{$i} {
    font-size: $i + rpx;
  }
}

// 定义内外边距，历遍1-80
@for $i from 0 through 80 {

  // 只要双数和能被5除尽的数
  @if $i % 2==0 or $i % 5==0 {

    // 得出：u-margin-30或者u-m-30
    // .u-margin-#{$i}, .u-m-#{$i} {
    // 	margin: $i + rpx!important;
    // }
    .u-m-#{$i} {
      margin: $i + rpx !important;
    }

    // 得出：u-padding-30或者u-p-30
    // .u-padding-#{$i}, .u-p-#{$i} {
    // 	padding: $i + rpx!important;
    // }
    .u-p-#{$i} {
      padding: $i + rpx !important;
    }

    @each $short,
    $long in l left,
    t top,
    r right,
    b bottom {

      // 缩写版，结果如： u-m-l-30
      // 定义外边距
      .u-m-#{$short}-#{$i} {
        margin-#{$long}: $i + rpx !important;
      }

      // 定义内边距
      .u-p-#{$short}-#{$i} {
        padding-#{$long}: $i + rpx !important;
      }

      // 完整版，结果如：u-margin-left-30
      // 定义外边距
      // .u-margin-#{$long}-#{$i} {
      // 	margin-#{$long}: $i + rpx!important;
      // }

      // 定义内边距
      // .u-padding-#{$long}-#{$i} {
      // 	padding-#{$long}: $i + rpx!important;
      // }
    }
  }
}